//
//  DocumentController.h
//  NVAReader
//
//  Created by DuyLK on 6/4/14.
//  Copyright (c) 2014 com.nva.nvareader. All rights reserved.
//

#import <Foundation/Foundation.h>
#include "mupdf/fitz.h"
#import "DocRef.h"
#import "OutlineViewController.h"
#import "OutlineItem.h"
#import "ImageView.h"
#import "ThumbnailsController.h"
#import "PageController.h"
#import "ThumbnailsDelegate.h"
#import "ComboPageController.h"
#import "PageScrollDelegate.h"
#import "SearchController.h"
#import "HitView.h"
#import "CoolView.h"
@interface DocumentController : NSDocument<NSSplitViewDelegate,NSOutlineViewDelegate,ThumbnailsDelegate,NSComboBoxDelegate,PageScrollDelegate,NSTextFieldDelegate,NSTableViewDelegate,NSTextViewDelegate,NSWindowDelegate>
{
    NSArray *files;
	NSTimer *timer;
	DocRef *docRef;
    fz_document *doc;
	NSString *_filename;
	char *_filePath;
    int currentThumbnail;
    
    //page pdf
    fz_page *page;
    int number;
    int totalPage;
}
@property (assign) IBOutlet NSOutlineView *outLineView;
@property (assign) IBOutlet NSScrollView *outLineParent;
@property (assign) IBOutlet NSScrollView *searchTableView;
@property (assign) IBOutlet NSTableView *searchTable;

@property (assign) IBOutlet PXListView *listView;
@property (assign) IBOutlet PXListView *listPage;
@property (assign) IBOutlet NSSegmentedControl *segmentOutLineThumb;
@property (assign) IBOutlet NSSegmentedControl *segmentSearch;
@property (copy) ThumbnailsController *thumbnail;
@property (copy) PageController *pageController;
@property (copy) ComboPageController *comboPageController;
@property (copy) ComboPageController *comboZoomController;
@property (assign) IBOutlet NSSplitView *splitView;
@property (assign) IBOutlet NSView *leftControl;
@property (assign) IBOutlet NSView *rightControl;
@property (assign) IBOutlet NSComboBox *comboPage;
@property BOOL selectCombo;
@property int currentZoom;
@property (assign) IBOutlet NSComboBox *comboZoom;
@property (assign) IBOutlet NSSlider *sliderZoom;
@property (assign) IBOutlet NSWindow *window;
@property (assign) IBOutlet NSSearchField *searchField;
@property (copy) SearchController *searchController;
@property (copy) NSMutableDictionary *dataSearch;
@property (assign) IBOutlet NSProgressIndicator *progressSearch;
@property (copy) NSString *textSearch;
@property (assign) IBOutlet NSToolbar *toolbar;
@property (copy) NSColor *colorSetting;
@property int typeSettingColor;

- (void) openDocument: (NSString*)filename :(NSString *) filePath;
- (void) askForPassword: (NSString*)prompt;
- (void) onPasswordOkay:(NSString*)filename path:(char *)cstr document: (DocRef *)aDoc;
- (void) onPasswordCancel;
- (void) reload;
-(void) setPageCombobox:(int) numberPage;
-(void) startThreadSearch;
-(void)clearTextSearch;
@end
